
#include "hw_config.h"
#include "ds18b20.h"
#include "7segment.h"

static float adc_data_float_value = 0.0f;
static u16 adc_data_value = 0;

void main(void)
{


	u16 temperature;

	CLI();	// all interrupt disable
	 


	bsp_fnd_gpio_init();
	
	bsp_ds18b20_gpio_init();
	ds18b20_init();
	
	SEI();	// all interrupt enable

	while(1)
	{
		temperature = read_ds18b20_temperature (); // read temperature
		temperature *= 0.625; // convert the actual temperature of 10 times;
		while (temperature == 850)
		{
		       temperature = read_ds18b20_temperature(); // read temperature
		       temperature *= 0.625;
			_delay_ms (1);
		}		

		// usart_format_puts("temperature=%d\r\n", temperature);
		fnd_puts_temperature(temperature, 3);
	}

}
